#pragma once

#include "Globals.h"
#include "Point.h"

namespace game_engine
{

// Forward declaration
class GameObject;

/*!
 * \class Component
 * \brief 
 */
class Component
{
///////////////////////////////////////////////////////////////////////////////
// Attribute definition
///////////////////////////////////////////////////////////////////////////////
protected:
    string type;
    GameObject *object;

///////////////////////////////////////////////////////////////////////////////
// Method definition
///////////////////////////////////////////////////////////////////////////////
public:
    // Constructors and Destructors
    Component(void);
    Component(GameObject *obj);
    virtual ~Component(void) = 0;

    // Others
    Component* getComponent(GameObject* obj, const string &compType) const throw(...);
    const BOOL keyPressed(const UINT32 key) const;
    void forceKeyState(const UINT32 key, const BOOL pressed);

    virtual void initialize(void) throw(...);
    virtual void update(const FLOAT32 time);
    virtual void render(void) throw(...);
    virtual void finalize(void);

    // Getters
    const string& getType(void) const;
    GameObject* getObject(void) const;

    // Setters
    void setType(const string &t);
    void setObject(GameObject *obj);

protected:
    const utils::Point computeCameraOffset(void) const throw(...);

};

}
